Only set the text if it is not NULL. (#319930, Thomas Klausner)
authorMatthias Clasen <mclasen@redhat.com>
Thu, 27 Oct 2005 04:31:33 +0000 (04:31 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 27 Oct 2005 04:31:33 +0000 (04:31 +0000)
2005-10-27  Matthias Clasen  <mclasen@redhat.com>

* demos/gtk-demo/clipboard.c (paste_received): Only set the
text if it is not NULL.  (#319930, Thomas Klausner)

* gtk/gtkselection.c (gtk_selection_data_get_pixbuf): Close the
loader before trying to get the pixbuf.  (#319930, Thomas Klausner)

ChangeLog
ChangeLog.pre-2-10
demos/gtk-demo/clipboard.c
gtk/gtkselection.c

index 16b9e50d4ddfe23f4dfe0d7282ee48e0c120c310..b3e234c60cb36ecc3deb7c32308cf636036b58db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-27  Matthias Clasen  <mclasen@redhat.com>
+
+       * demos/gtk-demo/clipboard.c (paste_received): Only set the
+       text if it is not NULL.  (#319930, Thomas Klausner)
+
+       * gtk/gtkselection.c (gtk_selection_data_get_pixbuf): Close the
+       loader before trying to get the pixbuf.  (#319930, Thomas Klausner)
+
 2005-10-26  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkfilesystem.c (gtk_file_system_module_load): 
index 16b9e50d4ddfe23f4dfe0d7282ee48e0c120c310..b3e234c60cb36ecc3deb7c32308cf636036b58db 100644 (file)
@@ -1,3 +1,11 @@
+2005-10-27  Matthias Clasen  <mclasen@redhat.com>
+
+       * demos/gtk-demo/clipboard.c (paste_received): Only set the
+       text if it is not NULL.  (#319930, Thomas Klausner)
+
+       * gtk/gtkselection.c (gtk_selection_data_get_pixbuf): Close the
+       loader before trying to get the pixbuf.  (#319930, Thomas Klausner)
+
 2005-10-26  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkfilesystem.c (gtk_file_system_module_load): 
index 96a993db5a76a00ad5075c0a53ce8823a1727089..9a85685379c7b332cb45f74b8136147b6f8c3064 100644 (file)
@@ -41,7 +41,8 @@ paste_received (GtkClipboard *clipboard,
   entry = GTK_WIDGET (user_data);
   
   /* Set the entry text */
-  gtk_entry_set_text (GTK_ENTRY (entry), text);
+  if(text)
+    gtk_entry_set_text (GTK_ENTRY (entry), text);
 }
 
 void
index d6fa64c2fad0ef16491796d721ef158264c824a2..dc8683dea288230428ef997ce4f9193f344272e5 100644 (file)
@@ -1416,16 +1416,16 @@ gtk_selection_data_get_pixbuf (GtkSelectionData *selection_data)
     {
       loader = gdk_pixbuf_loader_new ();
       
-      if (gdk_pixbuf_loader_write (loader, 
-                                  selection_data->data,
-                                  selection_data->length,
-                                  NULL))
-       result = gdk_pixbuf_loader_get_pixbuf (loader);
+      gdk_pixbuf_loader_write (loader, 
+                              selection_data->data,
+                              selection_data->length,
+                              NULL);
+      gdk_pixbuf_loader_close (loader, NULL);
+      result = gdk_pixbuf_loader_get_pixbuf (loader);
       
       if (result)
        g_object_ref (result);
       
-      gdk_pixbuf_loader_close (loader, NULL);
       g_object_unref (loader);
     }